<?php


namespace App\Transformers\Product;


use App\Models\ProductCate;
use League\Fractal\TransformerAbstract;

class ProductCateTransformer extends TransformerAbstract
{

    public function transform(ProductCate $data)
    {
        return [
            'id' => $data->id,
            'product_id' => $data->product_id ?? '',
            'first_category_id' => $data->first_category_id ?? '',
            'two_category_id' => $data->two_category_id ?? '',
            'three_category_id' => $data->three_category_id ?? '',
            'status' => $data->status ?? '',
            'deleted_at' => $data->deleted_at ? $data->deleted_at->format("Y-m-d H:i:s") : '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }


}
